package com.zzw.springboot.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 用户实体类
 */
//如果SysUser实体类名和数据库表名一致，则不需要加@TableName注解
@ApiModel("用户实体类")
@Data
//@TableName("sys_user")
public class SysUser {
    //这里我们使用@TableId, 表主键标识
    //当我们在private Integer id上标识了@TableId, 说明id对应的就是表的id字段, 而且是主键
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @NotEmpty(message = "用户名不能为空")
    private String username;

    @NotEmpty(message = "密码不能为空")
    private String password;

    @NotEmpty(message = "邮箱不能为空")
    private String email;

    @NotEmpty(message = "手机号不能为空")
    private String mobilePhone;

    @NotNull(message = "用户状态不能为空")
    private Integer status;

    @NotNull(message = "用户状态不能为空")
    private Date createTime;

    @NotNull(message = "用户状态不能为空")
    private Date updateTime;

    // @NotEmpty(message = "用户头像不能为空")
    private String avatar;

    @NotNull(message = "用户状态不能为空")
    private Integer gender;

    @NotEmpty(message = "用户昵称不能为空")
    private String nickname;

    @NotEmpty(message = "真实姓名不能为空")
    private String realName;

    // @NotEmpty(message = "部门ID不能为空")
    private Integer deptId;

    // @NotEmpty(message = "最后登录时间不能为空")
    private Date lastLoginTime;

    // @NotEmpty(message = "最后登录IP不能为空")
    private String lastLoginIp;

    @TableField("is_deleted")
    @TableLogic(value = "0", delval = "1")
    private Integer isDeleted;

    private String remark;
}
